cmake_minimum_required(VERSION 3.0.2)
project(learning_topic)

message("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaa")

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  roscpp
  rospy
  std_msgs
  turtlesim

  message_generation
)


## add_message_files
## add_service_files
## add_action_files


add_message_files(FILES
    Person.msg
    nav_state.msg)
generate_messages(DEPENDENCIES std_msgs)

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################


###################################
## catkin specific configuration ##
###################################

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES learning_topic
   CATKIN_DEPENDS geometry_msgs roscpp rospy std_msgs turtlesim message_runtime
#  DEPENDS system_lib
)


###########
## Build ##
###########

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

## 声明C++库
## CMake函数 add_library()指定用于编译的库文件，默认情况下，catkin编译共享库。
## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/learning_topic.cpp
# )



add_executable(velocity_publisher src/velocity_publisher.cpp)
target_link_libraries(velocity_publisher ${catkin_LIBRARIES})

add_executable(pose_subscriber src/pose_subscriber.cpp)
target_link_libraries(pose_subscriber ${catkin_LIBRARIES})


add_executable(person_publisher src/person_publisher.cpp)
target_link_libraries(person_publisher ${catkin_LIBRARIES})
add_dependencies(person_publisher ${PROJECT_NAME}_generate_messages_cpp)

add_executable(person_subscriber src/person_subscriber.cpp)
target_link_libraries(person_subscriber ${catkin_LIBRARIES})
add_dependencies(person_subscriber ${PROJECT_NAME}_generate_messages_cpp)

add_executable(person_subscriber_2 src/person_subscriber_2.cpp)
target_link_libraries(person_subscriber_2 ${catkin_LIBRARIES})
add_dependencies(person_subscriber_2 ${PROJECT_NAME}_generate_messages_cpp)


add_executable(Hello_pub src/Hello_pub.cpp)
add_executable(Hello_sub src/Hello_sub.cpp)

target_link_libraries(Hello_pub ${catkin_LIBRARIES})
target_link_libraries(Hello_sub ${catkin_LIBRARIES})




#############
## Install ##
#############



#############
## Testing ##
#############

